package org.ideo.service;

import java.util.ArrayList;

import org.ideo.model.User;


public class DummyUserManager implements UserManager {

	private ArrayList<User> users = new ArrayList<User>();

	public DummyUserManager() {
		users.add(new User("john","john.smith@mail.com","password"));
		users.add(new User("alice","alice.bob@domain.com","alicebob"));
	}

	public User findUser(String username, String password) {
		for (User user : users) {
			if (user.getUsername().equals(username) && user.getPassword().equals(password)) {
				return user;
			}
		}
		return null;
	}

	public void addUser(User user) {
		if (user != null) {
			users.add(user);
		}
	}
}
